package io.github.bigbird0101.youyishi.code.event;

import io.github.bigbird0101.youyishi.code.CodeContent;

import java.util.List;

/**
 * @author m15179835326@163.com
 * @date 2023-05-12 15:02
 */
public class DestroyFailedEvent extends CodeEvent {
    private final Throwable throwable;

    public DestroyFailedEvent(List<CodeContent<?>> codeContents, Throwable throwable) {
        super(codeContents);
        this.throwable = throwable;
    }

    @SuppressWarnings("unchecked")
    @Override
    public List<CodeContent<?>> getSource() {
        return (List<CodeContent<?>>) super.getSource();
    }

    public Throwable getThrowable() {
        return throwable;
    }
}